package com.kili.recommend.data.dto;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author fenny
 * @since 2019/08/30
 */
@Getter
@Setter
@Builder
public class CalculateScoreDto {

    private Long userId;

    List<EventWeight> weights;

    private BigDecimal sumWeight;

    public BigDecimal getSumWeight() {
        return weights.stream().map(EventWeight::getWeight).reduce(BigDecimal.ZERO, BigDecimal::add);
    }

}
